package com.example.udpDemo.socket.design.clone;

import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil;
import lombok.Data;

/**
 * @author wangdachuan
 * @version 1.0
 * @date 2023/4/2 01:04
 **/
@Data
public class DeviceEntity implements Cloneable{

    private String name;

    private String code;

    private String cloudCode;

    public DeviceEntity() {
    }

    public DeviceEntity(String name) {
        this.name = name;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        DeviceEntity cloneDevice = (DeviceEntity) super.clone();
        cloneDevice.setName(cloneDevice.getName() + RandomUtil.randomNumbers(1));
        return cloneDevice;
    }
}
